<template>
	<view class="body">
		<view class="relic-big-img" @click="preview">
			<image :src="relic.photo" mode="" class="img"></image>
		</view>
		<view class="relic-content">
			<view class="title">
				{{relic.exhibitName}}
			</view>
			<view class="relic-info">
				<view class="">所属年代：{{relic.year}}</view>
				<view class="">藏品类别：{{relic.exhibitCategories}}</view>
				<view class="">外观尺寸：{{relic.exhibitInfo}}</view>
			</view>
			<view class="praise-box">
				<view class="text">点赞数：</view>
				<uni-icons type="heart-filled" color="red"></uni-icons>
				<view class="">{{relic.praises}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				relic: {},
				//测试使用
				// relic: {
				// 	exhibitId :"b8b1d3d4-e84b-48dd-81ab-de3843ba8c83",
				// 	exhibitNo :"1",
				// 	exhibitName :"南汉佛塔模型",
				// 	photo :"http://8.138.83.48:9000/library/relic/pottery/pottery1.jpeg",
				// 	exhibitCategories :"陶器",
				// 	year: "五代十国",
				// 	unearthedSite :"2003致美斋遗址发掘出土",
				// 	exhibitInfo :"底径10cm，高12cm",
				// 	praises :28,
				// 	hits :1,
				// 	createTime :"2023-10-31T13:51:21.000+00:00",
				// 	updateTime :"2023-11-01T09:17:43.000+00:00"
				// }
			};
		},
		methods: {
			//初始化传来的文物信息到本页面
			setRelic(relic) {
				this.relic = JSON.parse(relic)
			},
			//点击文物图片可放大预览
			preview() {
				// console.log("放大图片")
				uni.previewImage({
					current: this.relic.photo,
					urls: [this.relic.photo]
				})
			}
		},
		onLoad(options) {
			// console.log(JSON.parse(options.detail))
			this.setRelic(options.detail)
			
		}
	}
</script>

<style lang="scss">

.body {
	
	.relic-big-img {
		display: flex;
		justify-content: center;
		margin: 10px;
	}
	.relic-content {
		.title {
			font-size: 18px;
			font-weight: bold;
			margin: 5px;
		}
		.relic-info {
			font-size: 15px;
			margin: 10px;
		}
		.praise-box {
			display: flex;
			.text {
				font-size: 18px;
				font-weight: bold;
			}
		}
	}
}
</style>


